﻿using System;

namespace ConsoleApp14
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] arr = new int[5] { 1, 2, 3, 4, 5 };
            for (int i = 0; i < arr.Length; i++)
            {
                Console.WriteLine(arr[i]);
            }

            int[] arr1 = new int[5];
            for (int j = 0; j < arr1.Length; j++)
            {
                Console.WriteLine(arr1[j]);
            }

            int[,] arr2 = new int[3, 3]
            {
                {1,2,3 },
                {10,20,30 },
                {100,200,300 }
            };
            Console.WriteLine(arr2[2, 0]);


            int sum = 0;
            int[] sums = new int[] { 2, 4, 6, 8, 10, 12, 14, 16, 18, 20 };
            foreach(int i in sums)
            {
                Console.WriteLine(i);
                sum = sum + i;
            }
            Console.WriteLine("数组总和为：" + sum);
            Console.ReadKey();
        
        }
    }
}
